# docker login --username 378661553@qq.com --password klKA1o14qwn registry.cn-hangzhou.aliyuncs.com
# shellcheck disable=SC2086
function sync_image() {
    registry="registry-vpc.cn-hangzhou.aliyuncs.com" #杭州 内网镜像仓库
    registry="registry.cn-hangzhou.aliyuncs.com" #杭州 外网镜像仓库
    src_image_name=$1
    to_image_name=$2
    docker pull $src_image_name
    docker tag $src_image_name $registry/mrzhou1553/$to_image_name
    docker push $registry/mrzhou1553/$to_image_name
}


sync_image mysql:8.0.37                   mysql:8.0.37
sync_image mysql:8.4.0                    mysql:8.4.0
sync_image nginx:1.23.1                   nginx:1.23.1
sync_image nginx:1.27.0                   nginx:1.27.0
sync_image redis:5.0.14                   redis:5.0.14
sync_image redis:6.2.14                   redis:6.2.14
sync_image redis:7.2.5                    redis:7.2.5
sync_image zlmediakit/zlmediakit:master   zlmediakit:master
sync_image ubuntu:24.04                   ubuntu:24.04
sync_image ubuntu:22.04                   ubuntu:22.04
sync_image busybox:1.36.1                 busybox:1.36.1
sync_image mongo:7.0.12                   mongo:7.0.12
sync_image emqx:5.7.1                     emqx:5.7.1
sync_image emqx:4.4.19                    emqx:4.4.19
sync_image nacos/nacos-server:v2.3.2      nacos-server:v2.3.2
sync_image nacos/nacos-server:v1.4.7      nacos-server:v1.4.7
sync_image jenkins/jenkins:2.464-jdk17    jenkins:2.464-jdk17
sync_image sonatype/nexus3:3.69.0-java17  nexus3:3.69.0-java17
sync_image portainer/portainer-ce:2.20.3  portainer-ce:2.20.3
sync_image quay.io/coreos/etcd:v3.5.5     quay.io-coreos-etcd:v3.5.5
sync_image milvusdb/milvus:v2.3.10        milvusdb-milvus:v2.3.10
sync_image zilliz/attu:v2.3.10            zilliz-attu:v2.3.10
sync_image minio/minio:RELEASE.2024-06-29T01-20-47Z  minio:RELEASE.2024-06-29T01-20-47Z
sync_image minio/minio:RELEASE.2023-03-20T20-16-18Z  minio:RELEASE.2023-03-20T20-16-18Z



function pull_image() {
    registry="registry-vpc.cn-hangzhou.aliyuncs.com" #杭州 内网镜像仓库
    registry="registry.cn-hangzhou.aliyuncs.com" #杭州 外网镜像仓库
    src_image_name=$1
    to_image_name=$2
    docker pull $src_image_name
    docker tag $src_image_name $to_image_name
    docker rmi $src_image_name
}


pull_image registry.cn-hangzhou.aliyuncs.com/mrzhou1553/nginx:1.27.0 nginx:1.27.0
pull_image registry.cn-hangzhou.aliyuncs.com/mrzhou1553/mysql:8.0.38 mysql:8.0.38
pull_image registry.cn-hangzhou.aliyuncs.com/mrzhou1553/redis:7.2.5 redis:7.2.5